//
//  YWButton.m
//  YWCalendar
//
//  Created by YR on 2017/5/25.
//  Copyright © 2017年 YR. All rights reserved.
//

#import "YWButton.h"

#import "NSCalendar+YWDateConvertor.h"

@implementation YWButton

- (void)setDayDate:(NSDate *)dayDate {
    _dayDate = dayDate;
    NSDateComponents *day = [[NSCalendar currentCalendar] yw_yearMonthDayFromDate:dayDate];
    [self setTitle:[@([day day]) stringValue] forState:UIControlStateNormal];
    [self setNeedsLayout];
}

- (void)setDidSelected:(BOOL)didSelected {
    self.selected = didSelected;
    self.titleLabel.font = self.selected?[UIFont systemFontOfSize:18]:[UIFont systemFontOfSize:14];
}

@end
